<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<form class="corner3" action="<spring:url value="/thanh-vien/xu-ly-chinh-sua-avatar.htm" />" method="post" enctype="multipart/form-data">
	<fieldset class="corner3">
		<legend align="center">Chỉnh sửa avatar</legend>		
		<article id="boxDetailInfo" class="corner3">
			<div id="boxInfoPersonal">
				<section>
					<label>&nbsp;</label>
					<span style="color:red">${notice}</span>
				</section>
				<c:if test="${userInfo.avatar != null}">
					<section>
						<label for="avatar">Avatar hiện tại: </label>
						<img id="image" src="${userInfo.avatar}/s96/" width="96" height="96" />
					</section>
				</c:if>
				<section>
					<label>Chọn up avatar từ: </label>
					<select id="sourceUpAvatar">
						<option value="1">Từ máy của bạn</option>
						<option value="2">Từ link ảnh</option>
					</select>
				</section>
				<section id="pcImage">
					<label for="fileData">Chọn ảnh từ máy: </label>
					<input type="file" id="fileData" name="fileData" class="validate[custom[image],required]" />
				</section>
				<section id="linkImage" style="display:none;">
					<label for="avatar">Link ảnh: </label>
					<input type="text" id="avatar" name="avatar" class="validate[custom[url,image],required]" placeholder="http://..." />
				</section>
				<section>
					<label>&nbsp;</label>
					<strong>Chọn ảnh có kích thước lớn nhất là 96 x 96 để avatar của bạn hiển thị đẹp hơn nhé.</strong>
				</section>
				<section>
					<label>&nbsp;</label>
					<input type="hidden" name="id" id="id" value="${userInfo.id}" />
					<button class="corner buttonOrange" type="submit" name="btUpdate" id="btUpdate">Cập nhật</button>
				</section>
			</div>
		</article>
		<h6 class="clear">&nbsp;</h6>
	</fieldset>
</form>